﻿//**********************************************************
// ZoomPlayer
//**********************************************************
function ZoomPlayer(_player, _playerName)
{
	MediaPlayer.call(this, _player, _playerName);
	var _this = this;
	
	function initialize()
	{
	}
	
	var _processCommand = this.processCommand;
	this.processCommand = function(sender, args)
	{
		var command = args.command;
		var commandLowerCase = command.toLowerCase();
		if(commandLowerCase.substr(0, 13) == "callfunction:" && commandLowerCase.length > 13)
		{
			var func = command.substr(13);
			_player.SendCommand(ZoomPlayer.Command.CallZPFunction, func);
		}
		else if(commandLowerCase.substr(0, 15) == "callexfunction:" && commandLowerCase.length > 15)
		{
			var func = command.substr(15);
			_player.SendCommand(ZoomPlayer.Command.CallZPExFunction, func);
		}
		else
			return _processCommand.call(this, sender, args);

		args.processed = true;
		return true;
	}

	initialize();
}
Type.registerType('ZoomPlayer', MediaPlayer);
MediaController.registerPlayerType("Osh.ZoomPlayer.ZoomPlayerApplication", ZoomPlayer);

ZoomPlayer.Command = {};
ZoomPlayer.Command.CallZPFunction = 5100;
ZoomPlayer.Command.CallZPExFunction = 5110;
ZoomPlayer.Command.CallZPScanCode = 5120;



